<?php


namespace App\Remote\Rms;

use GuzzleHttp\Exception\GuzzleException;
use Symfony\Component\HttpFoundation\Request as RequestAlias;

class RmsUserRoleRemote extends BaseRmsRemote
{

    const ROLE_TYPE_LIST = [
        self::ROLE_WEB_TYPE      => "WEB",
        self::ROLE_POS_TYPE      => "POS",
        self::ROLE_BUSINESS_TYPE => "商家"
    ];

    // 角色的平台类型
    public const ROLE_WEB_TYPE      = 1;    // 运营中心
    public const ROLE_POS_TYPE      = 2;    // 收银机
    public const ROLE_BUSINESS_TYPE = 3;    // 商家 APP

    /**
     * 获取用户角色
     *
     * @param array $userIds
     * @param int $type
     * @param int $shopId
     * @param int $brandId
     * @return mixed|void
     * @throws GuzzleException
     */
    public static function getUserRoleByUserId(array $userIds, int $type = 1, int $shopId = 0, int $brandId = 1)
    {
        return self::customCacheRequest(
            "api/internal/user/role",
            RequestAlias::METHOD_GET,
            [
                "userIds" => $userIds,
                "type"    => $type,
                "shopId"  => $shopId,
                "brandId" => $brandId
            ],
            null,
            0
        );
    }


}
